{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## CAPM模型"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## classwork1-书上例题301\n",
    "\n",
    "history(adjust=ADJUST_PREV, df= True,fill_missing=\"Last\")\n",
    "\n",
    "pd.merge\n",
    "\n",
    "dropna\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 获取数据SHSE.000902与SHSE.600596的数据在2014-01-01到2014-12-31之间的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from gm.api import *\n",
    "set_token(\"eea4b28a3ceb7048603d388bb777ebc67de47385\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt \n",
    "import statsmodels.api as sm\n",
    "import numpy as np  \n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "data_902 = history(symbol='SHSE.000902', frequency='1d', start_time='2014-01-01',  \n",
    "                       end_time='2014-12-31', fields='close,eob', adjust=ADJUST_PREV, df= True,fill_missing=\"Last\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>close</th>\n",
       "      <th>eob</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>3028.7490</td>\n",
       "      <td>2014-01-02 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>3001.4619</td>\n",
       "      <td>2014-01-03 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2927.4771</td>\n",
       "      <td>2014-01-06 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2938.6021</td>\n",
       "      <td>2014-01-07 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2950.7329</td>\n",
       "      <td>2014-01-08 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>240</th>\n",
       "      <td>4308.4941</td>\n",
       "      <td>2014-12-25 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>241</th>\n",
       "      <td>4396.2959</td>\n",
       "      <td>2014-12-26 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>242</th>\n",
       "      <td>4370.1890</td>\n",
       "      <td>2014-12-29 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>243</th>\n",
       "      <td>4334.9771</td>\n",
       "      <td>2014-12-30 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>244</th>\n",
       "      <td>4403.6182</td>\n",
       "      <td>2014-12-31 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>245 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         close                       eob\n",
       "0    3028.7490 2014-01-02 00:00:00+08:00\n",
       "1    3001.4619 2014-01-03 00:00:00+08:00\n",
       "2    2927.4771 2014-01-06 00:00:00+08:00\n",
       "3    2938.6021 2014-01-07 00:00:00+08:00\n",
       "4    2950.7329 2014-01-08 00:00:00+08:00\n",
       "..         ...                       ...\n",
       "240  4308.4941 2014-12-25 00:00:00+08:00\n",
       "241  4396.2959 2014-12-26 00:00:00+08:00\n",
       "242  4370.1890 2014-12-29 00:00:00+08:00\n",
       "243  4334.9771 2014-12-30 00:00:00+08:00\n",
       "244  4403.6182 2014-12-31 00:00:00+08:00\n",
       "\n",
       "[245 rows x 2 columns]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_902"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "data_596 = history(symbol='SHSE.600596', frequency='1d', start_time='2014-01-01',  \n",
    "                       end_time='2014-12-31', fields='close,eob', adjust=ADJUST_PREV, df= True,fill_missing=\"Last\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>close</th>\n",
       "      <th>eob</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>6.6178</td>\n",
       "      <td>2014-01-02 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>6.5514</td>\n",
       "      <td>2014-01-03 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>6.0986</td>\n",
       "      <td>2014-01-06 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>6.1046</td>\n",
       "      <td>2014-01-07 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>6.0744</td>\n",
       "      <td>2014-01-08 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>239</th>\n",
       "      <td>6.6437</td>\n",
       "      <td>2014-12-25 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>240</th>\n",
       "      <td>6.6684</td>\n",
       "      <td>2014-12-26 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>241</th>\n",
       "      <td>6.4829</td>\n",
       "      <td>2014-12-29 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>242</th>\n",
       "      <td>6.3839</td>\n",
       "      <td>2014-12-30 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>243</th>\n",
       "      <td>6.4210</td>\n",
       "      <td>2014-12-31 00:00:00+08:00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>244 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      close                       eob\n",
       "0    6.6178 2014-01-02 00:00:00+08:00\n",
       "1    6.5514 2014-01-03 00:00:00+08:00\n",
       "2    6.0986 2014-01-06 00:00:00+08:00\n",
       "3    6.1046 2014-01-07 00:00:00+08:00\n",
       "4    6.0744 2014-01-08 00:00:00+08:00\n",
       "..      ...                       ...\n",
       "239  6.6437 2014-12-25 00:00:00+08:00\n",
       "240  6.6684 2014-12-26 00:00:00+08:00\n",
       "241  6.4829 2014-12-29 00:00:00+08:00\n",
       "242  6.3839 2014-12-30 00:00:00+08:00\n",
       "243  6.4210 2014-12-31 00:00:00+08:00\n",
       "\n",
       "[244 rows x 2 columns]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_596"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 由于数据缺失，通过pd.merge基于eob连接数据，并计算对应的Ri Rm Rf，然后做出Rm-Rf 与Ri-Rf的散点图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>close_x</th>\n",
       "      <th>eob</th>\n",
       "      <th>close_y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>6.6178</td>\n",
       "      <td>2014-01-02 00:00:00+08:00</td>\n",
       "      <td>3028.7490</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>6.5514</td>\n",
       "      <td>2014-01-03 00:00:00+08:00</td>\n",
       "      <td>3001.4619</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>6.0986</td>\n",
       "      <td>2014-01-06 00:00:00+08:00</td>\n",
       "      <td>2927.4771</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>6.1046</td>\n",
       "      <td>2014-01-07 00:00:00+08:00</td>\n",
       "      <td>2938.6021</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>6.0744</td>\n",
       "      <td>2014-01-08 00:00:00+08:00</td>\n",
       "      <td>2950.7329</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>239</th>\n",
       "      <td>6.6437</td>\n",
       "      <td>2014-12-25 00:00:00+08:00</td>\n",
       "      <td>4308.4941</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>240</th>\n",
       "      <td>6.6684</td>\n",
       "      <td>2014-12-26 00:00:00+08:00</td>\n",
       "      <td>4396.2959</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>241</th>\n",
       "      <td>6.4829</td>\n",
       "      <td>2014-12-29 00:00:00+08:00</td>\n",
       "      <td>4370.1890</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>242</th>\n",
       "      <td>6.3839</td>\n",
       "      <td>2014-12-30 00:00:00+08:00</td>\n",
       "      <td>4334.9771</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>243</th>\n",
       "      <td>6.4210</td>\n",
       "      <td>2014-12-31 00:00:00+08:00</td>\n",
       "      <td>4403.6182</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>244 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     close_x                       eob    close_y\n",
       "0     6.6178 2014-01-02 00:00:00+08:00  3028.7490\n",
       "1     6.5514 2014-01-03 00:00:00+08:00  3001.4619\n",
       "2     6.0986 2014-01-06 00:00:00+08:00  2927.4771\n",
       "3     6.1046 2014-01-07 00:00:00+08:00  2938.6021\n",
       "4     6.0744 2014-01-08 00:00:00+08:00  2950.7329\n",
       "..       ...                       ...        ...\n",
       "239   6.6437 2014-12-25 00:00:00+08:00  4308.4941\n",
       "240   6.6684 2014-12-26 00:00:00+08:00  4396.2959\n",
       "241   6.4829 2014-12-29 00:00:00+08:00  4370.1890\n",
       "242   6.3839 2014-12-30 00:00:00+08:00  4334.9771\n",
       "243   6.4210 2014-12-31 00:00:00+08:00  4403.6182\n",
       "\n",
       "[244 rows x 3 columns]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data0=pd.merge(data_596,data_902,on=\"eob\")\n",
    "data0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "Rq=(data0.close_x/data0.shift(1).close_x-1).dropna()\n",
    "Rm=(data0.close_y/data0.shift(1).close_y-1).dropna()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "9.824689212445392e-05"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Rf=(1+0.036)**(1/360)-1\n",
    "Rf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "can't assign to operator (<ipython-input-23-f5063a0113ef>, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  File \u001b[1;32m\"<ipython-input-23-f5063a0113ef>\"\u001b[1;36m, line \u001b[1;32m1\u001b[0m\n\u001b[1;33m    Rq-Rf=a+b(Rm-Rf)\u001b[0m\n\u001b[1;37m                    ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m can't assign to operator\n"
     ]
    }
   ],
   "source": [
    "Rq-Rf=a+b(Rm-Rf)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x28a586d2c88>]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYkAAAD4CAYAAAAZ1BptAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAr8UlEQVR4nO3df5Ac5X3n8fdXq5FZ2Q4rxQKLRbIUlywfHEaCPaBKl9wZ/wDjnCXjYEOchLNdIVSZy+FydF6Cy8Y/7thY8TlxHWdOcaiTy8QIG7yWAzkZIye+4042K6+EkI0OgQFppQPFIJygDVqtvvfH9Cy9s90z3dM9Mz0zn1fV1s50P939zKz0fLufn+buiIiIRJnX7gyIiEhxKUiIiEgsBQkREYmlICEiIrEUJEREJNb8dmcgT6973et8xYoV7c6GiEhH2bVr19+7+5KofV0VJFasWMHY2Fi7syEi0lHM7Om4fapuEhGRWAoSIiISS0FCRERiKUiIiEgsBQkREYmVS5Aws8vNbL+ZHTCz4Yj9bzaz/2NmL5vZHyU51swWm9kDZvZ48HtRHnkVkeYYHZ9g3cgOVg7fx7qRHYyOT7Q7S5KDzEHCzPqA24B3AecA15jZOVXJngf+EPjTFMcOAw+6+yrgweC9iBTQ6PgEN927l4ljkzgwcWySm+7dq0DRBfJ4krgIOODuT7r7CeAuYH04gbs/5+4PA1Mpjl0PbAlebwE25JBXEWmCTdv3Mzk1PWvb5NQ0m7bvb1OOJC95BIlB4GDo/aFgW9Zjz3T3IwDB7zOiTmBm15nZmJmNHT16NFXGRSQfh49NptounSOPIGER25KuZJTl2HJi983uPuTuQ0uWRI4qF5EmO2ugP9V26Rx5BIlDwLLQ+7OBwzkc+6yZLQUIfj+XMZ8i0iQbL1tNf6lv1rb+Uh8bL1vdphxJXvIIEg8Dq8xspZktAK4GtuVw7Dbg2uD1tcB3csiriDTBhrWD3HrleQwO9GPA4EA/t155Hhv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Sf7NtSlf3wCOAFPB9/WRIuQN+JeUq3ceCf3buqIA+XoLMB7k61HgU3l+X438aFoOERGJpd5NIiISS0FCRERiKUiIiEgsBQkREYmlICEiIrEUJEREJJaChIiIxPr/DVS2I/srXRgAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(Rm-Rf,Rq-Rf,\"o\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x160ff110848>]"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYkAAAD4CAYAAAAZ1BptAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/d3fzzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAr8UlEQVR4nO3df5Ac5X3n8fdXq5FZ2Q4rxQKLRbIUlywfHEaCPaBKl9wZ/wDjnCXjYEOchLNdIVSZy+FydF6Cy8Y/7thY8TlxHWdOcaiTy8QIG7yWAzkZIye+4042K6+EkI0OgQFppQPFIJygDVqtvvfH9Cy9s90z3dM9Mz0zn1fV1s50P939zKz0fLufn+buiIiIRJnX7gyIiEhxKUiIiEgsBQkREYmlICEiIrEUJEREJNb8dmcgT6973et8xYoV7c6GiEhH2bVr19+7+5KofV0VJFasWMHY2Fi7syEi0lHM7Om4fapuEhGRWAoSIiISS0FCRERiKUiIiEgsBQkREYmVS5Aws8vNbL+ZHTCz4Yj9bzaz/2NmL5vZHyU51swWm9kDZvZ48HtRHnkVkeYYHZ9g3cgOVg7fx7qRHYyOT7Q7S5KDzEHCzPqA24B3AecA15jZOVXJngf+EPjTFMcOAw+6+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ZnaRu/+/Nuar2l8B95EiSDQ7b2Z2LfCbwNs8qKwtQr5yluRacWkWJDi2Hflqtkx5M7MS5QBxp7vfW5R8Vbj7MTP7W+ByoG1Bom2NIZ34A2xidmPnFyLSzAeepBwQKo1W50ake4r8Gq4z5QtYFUr374BvFeU7o/wf5KfAkiL+Lcmv4TrJtd7N7MbOH6f5N9fqfIX2r6A5DddZvjMDvgb8WcHytQQYCF73A/8T+M2885jq87Tz4p32A/wq8CDwePB7cbD9LOD+ULorKPeWeAK4OeZcT5FfkMiUL8p3U48CjwDfBQaL8p0BByjX3e4OfnLpeZVDvt5L+W7wZeBZYHsOeZpzLeB64PrgtQG3Bfv3EgpOSf7NtSlf3wCOAFPB9/WRIuQN+JeUq3ceCf3buqIA+XoLMB7k61HgU3l+X438aFoOERGJpd5NIiISS0FCRERiKUiIiEgsBQkREYmlICEiIrEUJEREJJaChIiIxPr/DVS2I/srXRgAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 通过sm.OLS函数进行线性拟合，并画出拟合结果"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\wp\\anaconda3\\lib\\site-packages\\statsmodels\\tsa\\tsatools.py:142: FutureWarning: In a future version of pandas all arguments of concat except for the argument 'objs' will be keyword-only\n",
      "  x = pd.concat(x[::order], 1)\n"
     ]
    }
   ],
   "source": [
    "model = sm.OLS((Rq-Rf), sm.add_constant(Rm-Rf))\n",
    "result = model.fit()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<table class=\"simpletable\">\n",
       "<caption>OLS Regression Results</caption>\n",
       "<tr>\n",
       "  <th>Dep. Variable:</th>         <td>close_x</td>     <th>  R-squared:         </th> <td>   0.242</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Model:</th>                   <td>OLS</td>       <th>  Adj. R-squared:    </th> <td>   0.239</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Method:</th>             <td>Least Squares</td>  <th>  F-statistic:       </th> <td>   77.02</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Date:</th>             <td>Wed, 01 Jun 2022</td> <th>  Prob (F-statistic):</th> <td>3.16e-16</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Time:</th>                 <td>21:21:30</td>     <th>  Log-Likelihood:    </th> <td>  580.35</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>No. Observations:</th>      <td>   243</td>      <th>  AIC:               </th> <td>  -1157.</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Df Residuals:</th>          <td>   241</td>      <th>  BIC:               </th> <td>  -1150.</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Df Model:</th>              <td>     1</td>      <th>                     </th>     <td> </td>   \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Covariance Type:</th>      <td>nonrobust</td>    <th>                     </th>     <td> </td>   \n",
       "</tr>\n",
       "</table>\n",
       "<table class=\"simpletable\">\n",
       "<tr>\n",
       "     <td></td>        <th>coef</th>     <th>std err</th>      <th>t</th>      <th>P>|t|</th>  <th>[0.025</th>    <th>0.975]</th>  \n",
       "</tr>\n",
       "<tr>\n",
       "  <th>const</th>   <td>   -0.0016</td> <td>    0.001</td> <td>   -1.102</td> <td> 0.272</td> <td>   -0.004</td> <td>    0.001</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>close_y</th> <td>    1.1238</td> <td>    0.128</td> <td>    8.776</td> <td> 0.000</td> <td>    0.872</td> <td>    1.376</td>\n",
       "</tr>\n",
       "</table>\n",
       "<table class=\"simpletable\">\n",
       "<tr>\n",
       "  <th>Omnibus:</th>       <td>49.522</td> <th>  Durbin-Watson:     </th> <td>   1.985</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Prob(Omnibus):</th> <td> 0.000</td> <th>  Jarque-Bera (JB):  </th> <td> 232.212</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Skew:</th>          <td> 0.695</td> <th>  Prob(JB):          </th> <td>3.77e-51</td>\n",
       "</tr>\n",
       "<tr>\n",
       "  <th>Kurtosis:</th>      <td> 7.583</td> <th>  Cond. No.          </th> <td>    89.5</td>\n",
       "</tr>\n",
       "</table><br/><br/>Notes:<br/>[1] Standard Errors assume that the covariance matrix of the errors is correctly specified."
      ],
      "text/plain": [
       "<class 'statsmodels.iolib.summary.Summary'>\n",
       "\"\"\"\n",
       "                            OLS Regression Results                            \n",
       "==============================================================================\n",
       "Dep. Variable:                close_x   R-squared:                       0.242\n",
       "Model:                            OLS   Adj. R-squared:                  0.239\n",
       "Method:                 Least Squares   F-statistic:                     77.02\n",
       "Date:                Wed, 01 Jun 2022   Prob (F-statistic):           3.16e-16\n",
       "Time:                        21:21:30   Log-Likelihood:                 580.35\n",
       "No. Observations:                 243   AIC:                            -1157.\n",
       "Df Residuals:                     241   BIC:                            -1150.\n",
       "Df Model:                           1                                         \n",
       "Covariance Type:            nonrobust                                         \n",
       "==============================================================================\n",
       "                 coef    std err          t      P>|t|      [0.025      0.975]\n",
       "------------------------------------------------------------------------------\n",
       "const         -0.0016      0.001     -1.102      0.272      -0.004       0.001\n",
       "close_y        1.1238      0.128      8.776      0.000       0.872       1.376\n",
       "==============================================================================\n",
       "Omnibus:                       49.522   Durbin-Watson:                   1.985\n",
       "Prob(Omnibus):                  0.000   Jarque-Bera (JB):              232.212\n",
       "Skew:                           0.695   Prob(JB):                     3.77e-51\n",
       "Kurtosis:                       7.583   Cond. No.                         89.5\n",
       "==============================================================================\n",
       "\n",
       "Notes:\n",
       "[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.\n",
       "\"\"\""
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [],
   "source": [
    "Rq1=[8.0,9.4,7.3]\n",
    "Rm1=[2.5,3.4,4.5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [],
   "source": [
    "Rq1=pd.Series(Rq1)\n",
    "Rm1=pd.Series(Rm1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.143333333333334"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Rq1.var()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([8. , 9.4, 7.3])"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Rq1.values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.018000000000000002"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "0.09-0.06*1.2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.041999999999999996"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "0.12-0.06*1.3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [],
   "source": [
    "Rqm=pd.DataFrame({\"a\":Rq1.values,\"b\":Rm1.values})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>a</th>\n",
       "      <th>b</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>a</th>\n",
       "      <td>1.1433</td>\n",
       "      <td>-0.4083</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>-0.4083</td>\n",
       "      <td>1.0033</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        a       b\n",
       "a  1.1433 -0.4083\n",
       "b -0.4083  1.0033"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Rqm.cov()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-0.3571137026239065"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "-0.4083/1.143333333333334"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "const     -0.0016\n",
       "close_y    1.1238\n",
       "dtype: float64"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result.params"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.8"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "4/5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.75"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "3/4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "x=np.arange(-0.04,0.035,0.005)\n",
    "y=-0.0016+1.1238*x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x28a5b833bc8>]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYkAAAD4CAYAAAAZ1BptAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAxc0lEQVR4nO3dfXxU9Z3o8c83IYEACgQSjDxjYyh21WoWdW0tLNZV2y7au1J1u6XVLXW3rtu6e6+03mutvbsvbNfauuvqpa13cV9tae6uD+jV6wMLtttWJbSa+kAkoJUIJYEICIQ8fu8f5wyZTM6ZOTPnzMyZ5Pt+vfKamfMw85sQft9zfg/fn6gqxhhjjJeyYhfAGGNMfFmQMMYY48uChDHGGF8WJIwxxviyIGGMMcbXuGIXIEozZszQ+fPnF7sYxhhTUrZt27ZfVWu89o2qIDF//nyam5uLXQxjjCkpIvJbv33W3GSMMcaXBQljjDG+LEgYY4zxZUHCGGOMLwsSxhhjfEUSJETkUhFpFZE2EVnjsX+RiPxSRHpE5G+DnCsi1SLyjIjscB+nRVFWY0yetDTB3R+A26c6jy1NxS6RiUDoICEi5cC9wGXAYuAaEVmcclgXcBPwD1mcuwbYpKr1wCb3tTEmjlqa4LGb4NBuQJ3Hx26yQDEKRHEns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gFORvrkjl+jGwF+hzf1/Xx6FswIdwmndakv62Lo9Buc4Efu2W6xXgtih/X7n8WFoOY4wxvmx0kzHGGF8WJIwxxviyIGGMMcaXBQljjDG+LEgYY4zxZUHCGGOMLwsSxhhjfP1/c/2eiTHyYUoAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(x,y)\n",
    "plt.plot(Rm-Rf,Rq-Rf,\"o\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x160fec4ba88>]"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYkAAAD4CAYAAAAZ1BptAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/d3fzzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAv0klEQVR4nO2dfXQc5Xnof49kyQgbZAlLxtgyGJDtGi4xoBoSGrBjoEBCDbnFAdqEBG4c2lBuSnIuTughJJyemHzR0BKoE2jMaYijm0IwXCgfvgaS3FCQCSh8CQtDsECxZAw2GGF9PfePmbVGq5nd2Z3Z3Vnt8ztHZ3dn3nfmWVl+n3mfT1FVDMMwDMOPqlILYBiGYSQXUxKGYRhGIKYkDMMwjEBMSRiGYRiBmJIwDMMwAplSagHiZObMmXrEEUeUWgzDMIyyYsuWLTtVtcnv3KRSEkcccQQdHR2lFsMwDKOsEJE/BJ0zc5NhGIYRiCkJwzAMIxBTEoZhGEYgpiQMwzCMQExJGIZhGIHEoiRE5CwR6RKRbhFZ43N+kYj8VkT2ichXwswVkUYReVhEtrqvDXHIahhGgehshxuPhetmOK+d7aWWy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4KiLOfZWTZPFyK8/SVNLniIMy9gsYUUs4ochWaWGQTkSOA43Ge2ksul4hUi8gzOO2cH1bVuOTKi6w9risNEXkEONTn1DVhL+FzTEXkQPcaZyZJrv1vVK8BrhGRrwJXAF9PimzuPa7B6VL40yTJFSNh7hU0ppByRpGr0ESWTUSmA/+B0/1yj8/YosulqiPAEtf/dreIHKuqBfHphMGURBqqenrQORHZkdqqutvpPp9hPTh+hxRzgTeBo4D5wLMikjr+tIgsVdU/llCudO4E/g85KIlCyyYilwCfAFaoa6xNglwxE+ZeQWNqQ8wthVyFJpJsIlKDoyB+qqp3JUWuFKr6jog8CpwFlExJlMwZUo4/wHcY7+z8ts+YKcA2HIWQclod4zPuNeJzXEeSC2j1jPs74BdJ+Z3h/Ad5AWhK4r8l8Tmuw9zr44x3dj6Zy99cseXynD+Cwjiuo/zOBLgD+KeEydUEzHDf1wG/Aj4Rt4w5fZ9S3rzcfoBDgE3AVve10T1+GHC/Z9w5ONESrwDXBFzrNeJTEpHkwnmaeg7oBO4F5iTldwZ049hun3F/Yom8ikGu83GeBvcBO4AHY5Bpwr2Ay4HL3fcC3Oye/z0e5RTmb65Ecv0M6AWG3N/XZUmQDfgzHPNOp+dv65wEyHUc8DtXrueAa+P8feXzY2U5DMMwjEAsuskwDMMIxJSEYRiGEYgpCcMwDCMQUxKGYRhGIKYkDMMwjEBMSRiGYRiBmJIwDMMwAvn/7AQeJr//oIAAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## classwork 2\n",
    "\n",
    "书本 306页题目"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## classwork3\n",
    "\n",
    "计算SHSE.000300中的股票的alpha与beta值，并选择其中alpha值为前10个股票，看是否接下来一年的平均收益高于SHSE.000300\n",
    "\n",
    "get_history_constituents"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [],
   "source": [
    "stock300 = get_history_constituents(index='SHSE.000300',start_date='2014-01-01',end_date='2014-12-31')[0]['constituents'].keys()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [],
   "source": [
    "stock_s=\"\"\n",
    "n=0\n",
    "for i in stock300:\n",
    "    n=n+1\n",
    "    stock_s=stock_s+i+\",\"\n",
    "    #print(i)\n",
    "    #if n==4:break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'SZSE.000001,SZSE.000002,SZSE.000012,SZSE.000009,SZSE.000024,SZSE.000039,SZSE.000100,SZSE.000046,SZSE.000060,SZSE.000061,SZSE.000063,SHSE.600000,SZSE.000069,SHSE.600010,SHSE.600011,SHSE.600008,SHSE.600009,SHSE.600015,SHSE.600016,SHSE.600018,SHSE.600019,SHSE.600030,SHSE.600031,SHSE.600027,SHSE.600028,SHSE.600029,SZSE.000156,SHSE.600036,SZSE.000157,SHSE.600100,SHSE.600050,SHSE.600048,SHSE.600104,SHSE.600060,SHSE.600111,SHSE.600062,SHSE.600108,SHSE.600058,SHSE.600109,SHSE.600115,SHSE.600066,SHSE.600068,SHSE.600123,SHSE.600118,SHSE.600079,SHSE.600085,SHSE.600143,SHSE.600089,SHSE.600150,SHSE.600096,SHSE.600153,SHSE.600160,SHSE.600157,SZSE.000333,SHSE.600208,SHSE.600170,SHSE.600216,SHSE.600221,SHSE.600166,SZSE.000338,SZSE.000400,SHSE.600219,SZSE.000401,SZSE.000402,SHSE.600177,SHSE.600188,SHSE.600196,SZSE.000423,SHSE.600252,SZSE.000425,SHSE.600256,SHSE.600309,SHSE.600259,SHSE.600315,SHSE.600271,SHSE.600266,SHSE.600316,SHSE.600267,SHSE.600276,SHSE.600332,SHSE.600340,SHSE.600352,SHSE.600348,SHSE.600403,SHSE.600406,SHSE.600362,SZSE.000528,SHSE.600415,SZSE.000536,SHSE.600372,SZSE.000538,SHSE.600369,SHSE.600376,SHSE.600383,SHSE.600436,SZSE.000562,SHSE.600395,SHSE.601001,SZSE.000568,SZSE.000623,SZSE.000630,SZSE.000625,SZSE.000581,SHSE.601006,SZSE.000629,SHSE.601009,SHSE.600516,SHSE.603993,SHSE.600518,SHSE.601018,SHSE.600519,SZSE.000651,SZSE.000596,SZSE.000703,SZSE.000598,SHSE.600528,SZSE.000656,SHSE.600535,SZSE.000709,SHSE.600489,SHSE.600600,SHSE.600546,SHSE.601101,SHSE.600547,SZSE.000718,SHSE.600497,SHSE.600498,SZSE.000725,SHSE.600549,SHSE.601111,SHSE.601106,SZSE.000728,SZSE.000729,SZSE.000686,SHSE.601117,SHSE.601118,SZSE.000800,SZSE.000750,SHSE.600582,SHSE.600583,SHSE.600585,SHSE.600642,SZSE.000758,SHSE.600637,SHSE.600588,SHSE.601088,SHSE.601139,SHSE.600597,SZSE.000768,SHSE.601098,SHSE.600648,SHSE.600703,SHSE.600598,SHSE.601099,SHSE.600649,SZSE.000831,SHSE.600655,SHSE.600705,SHSE.600660,SZSE.000826,SZSE.000776,SZSE.000778,SZSE.000783,SHSE.600663,SHSE.601158,SHSE.600664,SZSE.000792,SHSE.601166,SZSE.000793,SHSE.601168,SZSE.000839,SHSE.600718,SHSE.600674,SHSE.601169,SHSE.601231,SHSE.600690,SHSE.600741,SHSE.601186,SZSE.000858,SHSE.601238,SHSE.600688,SHSE.600739,SHSE.600694,SZSE.000869,SHSE.600804,SZSE.000876,SHSE.600811,SZSE.000933,SZSE.000878,SHSE.601258,SHSE.600809,SZSE.000937,SHSE.601318,SZSE.000895,SZSE.002001,SHSE.600827,SHSE.600832,SHSE.600783,SHSE.601333,SHSE.601328,SZSE.000960,SZSE.000961,SHSE.601336,SZSE.002007,SHSE.600837,SZSE.000963,SHSE.601288,SHSE.600839,SZSE.000970,SHSE.600795,SHSE.600900,SZSE.002024,SHSE.601299,SZSE.000983,SHSE.600863,SHSE.600859,SZSE.002038,SHSE.600873,SHSE.601369,SHSE.600875,SZSE.002051,SHSE.601377,SZSE.000999,SHSE.601390,SZSE.002106,SHSE.600886,SHSE.600887,SHSE.600893,SZSE.002065,SHSE.600895,SZSE.002069,SHSE.601398,SZSE.002081,SZSE.002129,SHSE.600970,SHSE.600971,SZSE.002142,SZSE.002146,SZSE.002202,SZSE.002155,SHSE.601600,SHSE.601601,SHSE.600997,SHSE.600999,SZSE.002230,SHSE.601555,SHSE.601607,SZSE.002236,SZSE.002241,SHSE.601618,SHSE.601633,SHSE.601628,SZSE.002304,SZSE.002310,SZSE.002269,SHSE.601666,SHSE.601717,SZSE.002294,SHSE.601668,SZSE.002344,SHSE.601669,SZSE.002353,SZSE.002299,SHSE.601688,SZSE.002415,SHSE.601800,SZSE.002422,SZSE.002375,SHSE.601699,SZSE.002431,SHSE.601808,SZSE.002385,SHSE.601766,SHSE.601818,SZSE.002450,SZSE.002500,SZSE.002399,SZSE.002456,SHSE.601901,SHSE.601857,SHSE.601866,SHSE.601918,SZSE.002603,SHSE.601928,SHSE.601933,SHSE.601888,SZSE.002570,SHSE.601939,SHSE.603000,SHSE.601898,SHSE.601899,SHSE.601958,SZSE.002594,SZSE.002653,SHSE.601991,SHSE.601992,SHSE.601988,SHSE.601989,SZSE.002673,SHSE.601998,'"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stock_s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "stock_s=\"\"\n",
    "n=0\n",
    "for i in stock300:\n",
    "    n=n+1\n",
    "    stock_s=stock_s+i+\",\"\n",
    "    if n==4:break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'SZSE.000063,SHSE.600000,SZSE.000069,SHSE.600010,'"
      ]
     },
     "execution_count": 87,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stock_s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Empty DataFrame\n",
       "Columns: []\n",
       "Index: []"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "history(symbol=\"SHSE.601990\", frequency='1d', start_time='2014-01-01',  \n",
    "                       end_time='2014-12-31', fields='close,eob,symbol', adjust=ADJUST_PREV, df= True,fill_missing=\"Last\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [],
   "source": [
    "data_300 = history(symbol=stock_s, frequency='1d', start_time='2014-01-01',  \n",
    "                       end_time='2014-12-31', fields='close,eob,symbol', adjust=ADJUST_PREV, df= True,fill_missing=\"Last\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>close</th>\n",
       "      <th>eob</th>\n",
       "      <th>symbol</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>12.9425</td>\n",
       "      <td>2014-01-02 00:00:00+08:00</td>\n",
       "      <td>SHSE.601607</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>6.8117</td>\n",
       "      <td>2014-01-02 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2.6563</td>\n",
       "      <td>2014-01-02 00:00:00+08:00</td>\n",
       "      <td>SHSE.600115</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>7.3521</td>\n",
       "      <td>2014-01-02 00:00:00+08:00</td>\n",
       "      <td>SHSE.600649</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.3493</td>\n",
       "      <td>2014-01-02 00:00:00+08:00</td>\n",
       "      <td>SHSE.601369</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32995</th>\n",
       "      <td>14.9777</td>\n",
       "      <td>2014-12-31 00:00:00+08:00</td>\n",
       "      <td>SZSE.000783</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32996</th>\n",
       "      <td>13.4837</td>\n",
       "      <td>2014-12-31 00:00:00+08:00</td>\n",
       "      <td>SZSE.000963</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32997</th>\n",
       "      <td>5.6924</td>\n",
       "      <td>2014-12-31 00:00:00+08:00</td>\n",
       "      <td>SZSE.000338</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32998</th>\n",
       "      <td>8.8080</td>\n",
       "      <td>2014-12-31 00:00:00+08:00</td>\n",
       "      <td>SZSE.000046</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32999</th>\n",
       "      <td>15.2070</td>\n",
       "      <td>2014-12-31 00:00:00+08:00</td>\n",
       "      <td>SZSE.002344</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>33000 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "         close                       eob       symbol\n",
       "0      12.9425 2014-01-02 00:00:00+08:00  SHSE.601607\n",
       "1       6.8117 2014-01-02 00:00:00+08:00  SHSE.600583\n",
       "2       2.6563 2014-01-02 00:00:00+08:00  SHSE.600115\n",
       "3       7.3521 2014-01-02 00:00:00+08:00  SHSE.600649\n",
       "4       5.3493 2014-01-02 00:00:00+08:00  SHSE.601369\n",
       "...        ...                       ...          ...\n",
       "32995  14.9777 2014-12-31 00:00:00+08:00  SZSE.000783\n",
       "32996  13.4837 2014-12-31 00:00:00+08:00  SZSE.000963\n",
       "32997   5.6924 2014-12-31 00:00:00+08:00  SZSE.000338\n",
       "32998   8.8080 2014-12-31 00:00:00+08:00  SZSE.000046\n",
       "32999  15.2070 2014-12-31 00:00:00+08:00  SZSE.002344\n",
       "\n",
       "[33000 rows x 3 columns]"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_300"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1     -0.0090\n",
       "2     -0.0246\n",
       "3      0.0038\n",
       "4      0.0041\n",
       "5     -0.0115\n",
       "        ...  \n",
       "239    0.0243\n",
       "240    0.0204\n",
       "241   -0.0059\n",
       "242   -0.0081\n",
       "243    0.0158\n",
       "Name: close_y, Length: 243, dtype: float64"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Rm"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>close</th>\n",
       "      <th>eob</th>\n",
       "      <th>symbol</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4.4014</td>\n",
       "      <td>2014-01-02 00:00:00+08:00</td>\n",
       "      <td>SHSE.600018</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5.8542</td>\n",
       "      <td>2014-01-02 00:00:00+08:00</td>\n",
       "      <td>SHSE.600031</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>11.0561</td>\n",
       "      <td>2014-01-02 00:00:00+08:00</td>\n",
       "      <td>SHSE.600030</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3.0748</td>\n",
       "      <td>2014-01-02 00:00:00+08:00</td>\n",
       "      <td>SHSE.600019</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4.2927</td>\n",
       "      <td>2014-01-03 00:00:00+08:00</td>\n",
       "      <td>SHSE.600018</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>929</th>\n",
       "      <td>5.3335</td>\n",
       "      <td>2014-12-30 00:00:00+08:00</td>\n",
       "      <td>SHSE.600019</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>930</th>\n",
       "      <td>5.5243</td>\n",
       "      <td>2014-12-31 00:00:00+08:00</td>\n",
       "      <td>SHSE.600018</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>931</th>\n",
       "      <td>9.3496</td>\n",
       "      <td>2014-12-31 00:00:00+08:00</td>\n",
       "      <td>SHSE.600031</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>932</th>\n",
       "      <td>30.1127</td>\n",
       "      <td>2014-12-31 00:00:00+08:00</td>\n",
       "      <td>SHSE.600030</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>933</th>\n",
       "      <td>5.4661</td>\n",
       "      <td>2014-12-31 00:00:00+08:00</td>\n",
       "      <td>SHSE.600019</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>934 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       close                       eob       symbol\n",
       "0     4.4014 2014-01-02 00:00:00+08:00  SHSE.600018\n",
       "1     5.8542 2014-01-02 00:00:00+08:00  SHSE.600031\n",
       "2    11.0561 2014-01-02 00:00:00+08:00  SHSE.600030\n",
       "3     3.0748 2014-01-02 00:00:00+08:00  SHSE.600019\n",
       "4     4.2927 2014-01-03 00:00:00+08:00  SHSE.600018\n",
       "..       ...                       ...          ...\n",
       "929   5.3335 2014-12-30 00:00:00+08:00  SHSE.600019\n",
       "930   5.5243 2014-12-31 00:00:00+08:00  SHSE.600018\n",
       "931   9.3496 2014-12-31 00:00:00+08:00  SHSE.600031\n",
       "932  30.1127 2014-12-31 00:00:00+08:00  SHSE.600030\n",
       "933   5.4661 2014-12-31 00:00:00+08:00  SHSE.600019\n",
       "\n",
       "[934 rows x 3 columns]"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_300"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>close</th>\n",
       "      <th>eob</th>\n",
       "      <th>symbol</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>6.8117</td>\n",
       "      <td>2014-01-02 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>296</th>\n",
       "      <td>6.6593</td>\n",
       "      <td>2014-01-03 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>592</th>\n",
       "      <td>6.4442</td>\n",
       "      <td>2014-01-06 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>889</th>\n",
       "      <td>6.4352</td>\n",
       "      <td>2014-01-07 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1186</th>\n",
       "      <td>6.4890</td>\n",
       "      <td>2014-01-08 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1482</th>\n",
       "      <td>7.1343</td>\n",
       "      <td>2014-01-09 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1779</th>\n",
       "      <td>7.2957</td>\n",
       "      <td>2014-01-10 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2077</th>\n",
       "      <td>7.1792</td>\n",
       "      <td>2014-01-13 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2375</th>\n",
       "      <td>7.4839</td>\n",
       "      <td>2014-01-14 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2673</th>\n",
       "      <td>7.4749</td>\n",
       "      <td>2014-01-15 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2971</th>\n",
       "      <td>7.3853</td>\n",
       "      <td>2014-01-16 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3269</th>\n",
       "      <td>7.3046</td>\n",
       "      <td>2014-01-17 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3566</th>\n",
       "      <td>7.3046</td>\n",
       "      <td>2014-01-20 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3863</th>\n",
       "      <td>7.4839</td>\n",
       "      <td>2014-01-21 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4160</th>\n",
       "      <td>7.6900</td>\n",
       "      <td>2014-01-22 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4457</th>\n",
       "      <td>7.7438</td>\n",
       "      <td>2014-01-23 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4753</th>\n",
       "      <td>7.7080</td>\n",
       "      <td>2014-01-24 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5049</th>\n",
       "      <td>7.5287</td>\n",
       "      <td>2014-01-27 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5346</th>\n",
       "      <td>7.5825</td>\n",
       "      <td>2014-01-28 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5642</th>\n",
       "      <td>7.7080</td>\n",
       "      <td>2014-01-29 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5938</th>\n",
       "      <td>7.5466</td>\n",
       "      <td>2014-01-30 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6236</th>\n",
       "      <td>7.6183</td>\n",
       "      <td>2014-02-07 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6534</th>\n",
       "      <td>7.8693</td>\n",
       "      <td>2014-02-10 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6832</th>\n",
       "      <td>7.8603</td>\n",
       "      <td>2014-02-11 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7130</th>\n",
       "      <td>7.8872</td>\n",
       "      <td>2014-02-12 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7428</th>\n",
       "      <td>7.6900</td>\n",
       "      <td>2014-02-13 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7725</th>\n",
       "      <td>7.7797</td>\n",
       "      <td>2014-02-14 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8022</th>\n",
       "      <td>7.7976</td>\n",
       "      <td>2014-02-17 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8318</th>\n",
       "      <td>7.8603</td>\n",
       "      <td>2014-02-18 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8615</th>\n",
       "      <td>7.6542</td>\n",
       "      <td>2014-02-19 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8910</th>\n",
       "      <td>7.6542</td>\n",
       "      <td>2014-02-20 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9206</th>\n",
       "      <td>7.5018</td>\n",
       "      <td>2014-02-21 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9504</th>\n",
       "      <td>7.2688</td>\n",
       "      <td>2014-02-24 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9801</th>\n",
       "      <td>7.1612</td>\n",
       "      <td>2014-02-25 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10097</th>\n",
       "      <td>7.3136</td>\n",
       "      <td>2014-02-26 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10393</th>\n",
       "      <td>7.2060</td>\n",
       "      <td>2014-02-27 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10689</th>\n",
       "      <td>7.0357</td>\n",
       "      <td>2014-02-28 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10985</th>\n",
       "      <td>7.1433</td>\n",
       "      <td>2014-03-03 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11281</th>\n",
       "      <td>7.1792</td>\n",
       "      <td>2014-03-04 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11577</th>\n",
       "      <td>6.9730</td>\n",
       "      <td>2014-03-05 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11873</th>\n",
       "      <td>6.9730</td>\n",
       "      <td>2014-03-06 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12169</th>\n",
       "      <td>6.9999</td>\n",
       "      <td>2014-03-07 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12466</th>\n",
       "      <td>6.8117</td>\n",
       "      <td>2014-03-10 00:00:00+08:00</td>\n",
       "      <td>SHSE.600583</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        close                       eob       symbol\n",
       "1      6.8117 2014-01-02 00:00:00+08:00  SHSE.600583\n",
       "296    6.6593 2014-01-03 00:00:00+08:00  SHSE.600583\n",
       "592    6.4442 2014-01-06 00:00:00+08:00  SHSE.600583\n",
       "889    6.4352 2014-01-07 00:00:00+08:00  SHSE.600583\n",
       "1186   6.4890 2014-01-08 00:00:00+08:00  SHSE.600583\n",
       "1482   7.1343 2014-01-09 00:00:00+08:00  SHSE.600583\n",
       "1779   7.2957 2014-01-10 00:00:00+08:00  SHSE.600583\n",
       "2077   7.1792 2014-01-13 00:00:00+08:00  SHSE.600583\n",
       "2375   7.4839 2014-01-14 00:00:00+08:00  SHSE.600583\n",
       "2673   7.4749 2014-01-15 00:00:00+08:00  SHSE.600583\n",
       "2971   7.3853 2014-01-16 00:00:00+08:00  SHSE.600583\n",
       "3269   7.3046 2014-01-17 00:00:00+08:00  SHSE.600583\n",
       "3566   7.3046 2014-01-20 00:00:00+08:00  SHSE.600583\n",
       "3863   7.4839 2014-01-21 00:00:00+08:00  SHSE.600583\n",
       "4160   7.6900 2014-01-22 00:00:00+08:00  SHSE.600583\n",
       "4457   7.7438 2014-01-23 00:00:00+08:00  SHSE.600583\n",
       "4753   7.7080 2014-01-24 00:00:00+08:00  SHSE.600583\n",
       "5049   7.5287 2014-01-27 00:00:00+08:00  SHSE.600583\n",
       "5346   7.5825 2014-01-28 00:00:00+08:00  SHSE.600583\n",
       "5642   7.7080 2014-01-29 00:00:00+08:00  SHSE.600583\n",
       "5938   7.5466 2014-01-30 00:00:00+08:00  SHSE.600583\n",
       "6236   7.6183 2014-02-07 00:00:00+08:00  SHSE.600583\n",
       "6534   7.8693 2014-02-10 00:00:00+08:00  SHSE.600583\n",
       "6832   7.8603 2014-02-11 00:00:00+08:00  SHSE.600583\n",
       "7130   7.8872 2014-02-12 00:00:00+08:00  SHSE.600583\n",
       "7428   7.6900 2014-02-13 00:00:00+08:00  SHSE.600583\n",
       "7725   7.7797 2014-02-14 00:00:00+08:00  SHSE.600583\n",
       "8022   7.7976 2014-02-17 00:00:00+08:00  SHSE.600583\n",
       "8318   7.8603 2014-02-18 00:00:00+08:00  SHSE.600583\n",
       "8615   7.6542 2014-02-19 00:00:00+08:00  SHSE.600583\n",
       "8910   7.6542 2014-02-20 00:00:00+08:00  SHSE.600583\n",
       "9206   7.5018 2014-02-21 00:00:00+08:00  SHSE.600583\n",
       "9504   7.2688 2014-02-24 00:00:00+08:00  SHSE.600583\n",
       "9801   7.1612 2014-02-25 00:00:00+08:00  SHSE.600583\n",
       "10097  7.3136 2014-02-26 00:00:00+08:00  SHSE.600583\n",
       "10393  7.2060 2014-02-27 00:00:00+08:00  SHSE.600583\n",
       "10689  7.0357 2014-02-28 00:00:00+08:00  SHSE.600583\n",
       "10985  7.1433 2014-03-03 00:00:00+08:00  SHSE.600583\n",
       "11281  7.1792 2014-03-04 00:00:00+08:00  SHSE.600583\n",
       "11577  6.9730 2014-03-05 00:00:00+08:00  SHSE.600583\n",
       "11873  6.9730 2014-03-06 00:00:00+08:00  SHSE.600583\n",
       "12169  6.9999 2014-03-07 00:00:00+08:00  SHSE.600583\n",
       "12466  6.8117 2014-03-10 00:00:00+08:00  SHSE.600583"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_300[data_300[\"symbol\"]==\"SHSE.600583\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>close</th>\n",
       "      <th>eob</th>\n",
       "      <th>symbol</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Empty DataFrame\n",
       "Columns: [close, eob, symbol]\n",
       "Index: []"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_300[data_300[\"symbol\"]==\"SHSE.603019\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>close</th>\n",
       "      <th>eob</th>\n",
       "      <th>symbol</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Empty DataFrame\n",
       "Columns: [close, eob, symbol]\n",
       "Index: []"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_300[data_300[\"symbol\"]==\"SHSE.601600\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>close_x</th>\n",
       "      <th>eob</th>\n",
       "      <th>close_y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>9.6134</td>\n",
       "      <td>2014-01-02 00:00:00+08:00</td>\n",
       "      <td>3028.7490</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>9.5170</td>\n",
       "      <td>2014-01-03 00:00:00+08:00</td>\n",
       "      <td>3001.4619</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>8.8591</td>\n",
       "      <td>2014-01-06 00:00:00+08:00</td>\n",
       "      <td>2927.4771</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>8.8679</td>\n",
       "      <td>2014-01-07 00:00:00+08:00</td>\n",
       "      <td>2938.6021</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>8.8240</td>\n",
       "      <td>2014-01-08 00:00:00+08:00</td>\n",
       "      <td>2950.7329</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>239</th>\n",
       "      <td>9.6510</td>\n",
       "      <td>2014-12-25 00:00:00+08:00</td>\n",
       "      <td>4308.4941</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>240</th>\n",
       "      <td>9.6870</td>\n",
       "      <td>2014-12-26 00:00:00+08:00</td>\n",
       "      <td>4396.2959</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>241</th>\n",
       "      <td>9.4174</td>\n",
       "      <td>2014-12-29 00:00:00+08:00</td>\n",
       "      <td>4370.1890</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>242</th>\n",
       "      <td>9.2736</td>\n",
       "      <td>2014-12-30 00:00:00+08:00</td>\n",
       "      <td>4334.9771</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>243</th>\n",
       "      <td>9.3275</td>\n",
       "      <td>2014-12-31 00:00:00+08:00</td>\n",
       "      <td>4403.6182</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>244 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     close_x                       eob    close_y\n",
       "0     9.6134 2014-01-02 00:00:00+08:00  3028.7490\n",
       "1     9.5170 2014-01-03 00:00:00+08:00  3001.4619\n",
       "2     8.8591 2014-01-06 00:00:00+08:00  2927.4771\n",
       "3     8.8679 2014-01-07 00:00:00+08:00  2938.6021\n",
       "4     8.8240 2014-01-08 00:00:00+08:00  2950.7329\n",
       "..       ...                       ...        ...\n",
       "239   9.6510 2014-12-25 00:00:00+08:00  4308.4941\n",
       "240   9.6870 2014-12-26 00:00:00+08:00  4396.2959\n",
       "241   9.4174 2014-12-29 00:00:00+08:00  4370.1890\n",
       "242   9.2736 2014-12-30 00:00:00+08:00  4334.9771\n",
       "243   9.3275 2014-12-31 00:00:00+08:00  4403.6182\n",
       "\n",
       "[244 rows x 3 columns]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data0=pd.merge(data_596,data_902,on=\"eob\")\n",
    "data0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "def dj(data_596):\n",
    "    data0=pd.merge(data_596,data_902,on=\"eob\")\n",
    "    Rq=(data0.close_x/data0.shift(1).close_x-1).dropna()\n",
    "    Rm=(data0.close_y/data0.shift(1).close_y-1).dropna()\n",
    "    model = sm.OLS((Rq-Rf), sm.add_constant(Rm-Rf))\n",
    "    result = model.fit()\n",
    "    return result.params"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "const      0.0009\n",
       "close_y    0.7660\n",
       "dtype: float64"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dj(data_300[data_300[\"symbol\"]==\"SHSE.600583\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [],
   "source": [
    "s=[]\n",
    "const1=[]\n",
    "close_y=[]\n",
    "n=0\n",
    "for i in stock300:\n",
    "    n=n+1\n",
    "    try:\n",
    "        z1=dj(data_300[data_300[\"symbol\"]==i])\n",
    "        #print(z1,i)\n",
    "        s.append(i)\n",
    "        const1.append(z1.const)\n",
    "        close_y.append(z1.close_y)\n",
    "    except:\n",
    "        continue\n",
    "    #if n==4:break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [],
   "source": [
    "r1=pd.DataFrame({\"symbol\":s,\"const\":const1,\"close_y\":close_y})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>symbol</th>\n",
       "      <th>const</th>\n",
       "      <th>close_y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>SZSE.000001</td>\n",
       "      <td>0.0003</td>\n",
       "      <td>1.0967</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>SZSE.000002</td>\n",
       "      <td>0.0012</td>\n",
       "      <td>0.9856</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>SZSE.000012</td>\n",
       "      <td>-0.0011</td>\n",
       "      <td>1.0901</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>SZSE.000009</td>\n",
       "      <td>0.0010</td>\n",
       "      <td>1.0118</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>SZSE.000024</td>\n",
       "      <td>0.0011</td>\n",
       "      <td>1.3822</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>295</th>\n",
       "      <td>SHSE.601992</td>\n",
       "      <td>-0.0047</td>\n",
       "      <td>1.4735</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>296</th>\n",
       "      <td>SHSE.601988</td>\n",
       "      <td>-0.0012</td>\n",
       "      <td>0.2747</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>297</th>\n",
       "      <td>SHSE.601989</td>\n",
       "      <td>-0.0020</td>\n",
       "      <td>1.4499</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>298</th>\n",
       "      <td>SZSE.002673</td>\n",
       "      <td>0.0024</td>\n",
       "      <td>1.5581</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>299</th>\n",
       "      <td>SHSE.601998</td>\n",
       "      <td>0.0065</td>\n",
       "      <td>0.5489</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>300 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          symbol   const  close_y\n",
       "0    SZSE.000001  0.0003   1.0967\n",
       "1    SZSE.000002  0.0012   0.9856\n",
       "2    SZSE.000012 -0.0011   1.0901\n",
       "3    SZSE.000009  0.0010   1.0118\n",
       "4    SZSE.000024  0.0011   1.3822\n",
       "..           ...     ...      ...\n",
       "295  SHSE.601992 -0.0047   1.4735\n",
       "296  SHSE.601988 -0.0012   0.2747\n",
       "297  SHSE.601989 -0.0020   1.4499\n",
       "298  SZSE.002673  0.0024   1.5581\n",
       "299  SHSE.601998  0.0065   0.5489\n",
       "\n",
       "[300 rows x 3 columns]"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['SZSE.000562', 'SHSE.600588', 'SHSE.600109', 'SHSE.600688',\n",
       "       'SHSE.601099', 'SHSE.601098', 'SHSE.600582', 'SHSE.601998',\n",
       "       'SHSE.600519', 'SHSE.600893'], dtype=object)"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r1.sort_values(by=\"const\",ascending=False).head(10).symbol.values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>close</th>\n",
       "      <th>eob</th>\n",
       "      <th>symbol</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Empty DataFrame\n",
       "Columns: [close, eob, symbol]\n",
       "Index: []"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data_300[data_300[\"symbol\"]==\"SHSE.601990\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "ename": "ValueError",
     "evalue": "zero-size array to reduction operation maximum which has no identity",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mValueError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-77-ea692c79b23d>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mdj\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdata_300\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mdata_300\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m\"symbol\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m==\u001b[0m\u001b[1;34m\"SHSE.601990\"\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;32m<ipython-input-70-3115c901f909>\u001b[0m in \u001b[0;36mdj\u001b[1;34m(data_596)\u001b[0m\n\u001b[0;32m      3\u001b[0m     \u001b[0mRq\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdata0\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mclose_x\u001b[0m\u001b[1;33m/\u001b[0m\u001b[0mdata0\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mshift\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mclose_x\u001b[0m\u001b[1;33m-\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdropna\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      4\u001b[0m     \u001b[0mRm\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdata0\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mclose_y\u001b[0m\u001b[1;33m/\u001b[0m\u001b[0mdata0\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mshift\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mclose_y\u001b[0m\u001b[1;33m-\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdropna\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 5\u001b[1;33m     \u001b[0mmodel\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0msm\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mOLS\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mRq\u001b[0m\u001b[1;33m-\u001b[0m\u001b[0mRf\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0msm\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0madd_constant\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mRm\u001b[0m\u001b[1;33m-\u001b[0m\u001b[0mRf\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      6\u001b[0m     \u001b[0mresult\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mmodel\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfit\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      7\u001b[0m     \u001b[1;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mparams\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\anaconda3\\lib\\site-packages\\statsmodels\\regression\\linear_model.py\u001b[0m in \u001b[0;36m__init__\u001b[1;34m(self, endog, exog, missing, hasconst, **kwargs)\u001b[0m\n\u001b[0;32m    857\u001b[0m                  **kwargs):\n\u001b[0;32m    858\u001b[0m         super(OLS, self).__init__(endog, exog, missing=missing,\n\u001b[1;32m--> 859\u001b[1;33m                                   hasconst=hasconst, **kwargs)\n\u001b[0m\u001b[0;32m    860\u001b[0m         \u001b[1;32mif\u001b[0m \u001b[1;34m\"weights\"\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_init_keys\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    861\u001b[0m             \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_init_keys\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mremove\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"weights\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\anaconda3\\lib\\site-packages\\statsmodels\\regression\\linear_model.py\u001b[0m in \u001b[0;36m__init__\u001b[1;34m(self, endog, exog, weights, missing, hasconst, **kwargs)\u001b[0m\n\u001b[0;32m    700\u001b[0m             \u001b[0mweights\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mweights\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0msqueeze\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    701\u001b[0m         super(WLS, self).__init__(endog, exog, missing=missing,\n\u001b[1;32m--> 702\u001b[1;33m                                   weights=weights, hasconst=hasconst, **kwargs)\n\u001b[0m\u001b[0;32m    703\u001b[0m         \u001b[0mnobs\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mexog\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    704\u001b[0m         \u001b[0mweights\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mweights\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\anaconda3\\lib\\site-packages\\statsmodels\\regression\\linear_model.py\u001b[0m in \u001b[0;36m__init__\u001b[1;34m(self, endog, exog, **kwargs)\u001b[0m\n\u001b[0;32m    188\u001b[0m     \"\"\"\n\u001b[0;32m    189\u001b[0m     \u001b[1;32mdef\u001b[0m \u001b[0m__init__\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mendog\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mexog\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 190\u001b[1;33m         \u001b[0msuper\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mRegressionModel\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__init__\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mendog\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mexog\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    191\u001b[0m         \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_data_attr\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mextend\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'pinv_wexog'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'wendog'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'wexog'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'weights'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    192\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\anaconda3\\lib\\site-packages\\statsmodels\\base\\model.py\u001b[0m in \u001b[0;36m__init__\u001b[1;34m(self, endog, exog, **kwargs)\u001b[0m\n\u001b[0;32m    234\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    235\u001b[0m     \u001b[1;32mdef\u001b[0m \u001b[0m__init__\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mendog\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mexog\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mNone\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 236\u001b[1;33m         \u001b[0msuper\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mLikelihoodModel\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__init__\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mendog\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mexog\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    237\u001b[0m         \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0minitialize\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    238\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\anaconda3\\lib\\site-packages\\statsmodels\\base\\model.py\u001b[0m in \u001b[0;36m__init__\u001b[1;34m(self, endog, exog, **kwargs)\u001b[0m\n\u001b[0;32m     75\u001b[0m         \u001b[0mhasconst\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mpop\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'hasconst'\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     76\u001b[0m         self.data = self._handle_data(endog, exog, missing, hasconst,\n\u001b[1;32m---> 77\u001b[1;33m                                       **kwargs)\n\u001b[0m\u001b[0;32m     78\u001b[0m         \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mk_constant\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdata\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mk_constant\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     79\u001b[0m         \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mexog\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdata\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mexog\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\anaconda3\\lib\\site-packages\\statsmodels\\base\\model.py\u001b[0m in \u001b[0;36m_handle_data\u001b[1;34m(self, endog, exog, missing, hasconst, **kwargs)\u001b[0m\n\u001b[0;32m     98\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     99\u001b[0m     \u001b[1;32mdef\u001b[0m \u001b[0m_handle_data\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mendog\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mexog\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mmissing\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mhasconst\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 100\u001b[1;33m         \u001b[0mdata\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mhandle_data\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mendog\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mexog\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mmissing\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mhasconst\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    101\u001b[0m         \u001b[1;31m# kwargs arrays could have changed, easier to just attach here\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    102\u001b[0m         \u001b[1;32mfor\u001b[0m \u001b[0mkey\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\anaconda3\\lib\\site-packages\\statsmodels\\base\\data.py\u001b[0m in \u001b[0;36mhandle_data\u001b[1;34m(endog, exog, missing, hasconst, **kwargs)\u001b[0m\n\u001b[0;32m    670\u001b[0m     \u001b[0mklass\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mhandle_data_class_factory\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mendog\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mexog\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    671\u001b[0m     return klass(endog, exog=exog, missing=missing, hasconst=hasconst,\n\u001b[1;32m--> 672\u001b[1;33m                  **kwargs)\n\u001b[0m",
      "\u001b[1;32m~\\anaconda3\\lib\\site-packages\\statsmodels\\base\\data.py\u001b[0m in \u001b[0;36m__init__\u001b[1;34m(self, endog, exog, missing, hasconst, **kwargs)\u001b[0m\n\u001b[0;32m     85\u001b[0m         \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mconst_idx\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     86\u001b[0m         \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mk_constant\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;36m0\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 87\u001b[1;33m         \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_handle_constant\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mhasconst\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m     88\u001b[0m         \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_check_integrity\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     89\u001b[0m         \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_cache\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m{\u001b[0m\u001b[1;33m}\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\anaconda3\\lib\\site-packages\\statsmodels\\base\\data.py\u001b[0m in \u001b[0;36m_handle_constant\u001b[1;34m(self, hasconst)\u001b[0m\n\u001b[0;32m    129\u001b[0m             \u001b[1;31m# detect where the constant is\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    130\u001b[0m             \u001b[0mcheck_implicit\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;32mFalse\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 131\u001b[1;33m             \u001b[0mexog_max\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mmax\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mexog\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    132\u001b[0m             \u001b[1;32mif\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0misfinite\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mexog_max\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mall\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    133\u001b[0m                 \u001b[1;32mraise\u001b[0m \u001b[0mMissingDataError\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'exog contains inf or nans'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m<__array_function__ internals>\u001b[0m in \u001b[0;36mamax\u001b[1;34m(*args, **kwargs)\u001b[0m\n",
      "\u001b[1;32m~\\anaconda3\\lib\\site-packages\\numpy\\core\\fromnumeric.py\u001b[0m in \u001b[0;36mamax\u001b[1;34m(a, axis, out, keepdims, initial, where)\u001b[0m\n\u001b[0;32m   2732\u001b[0m     \"\"\"\n\u001b[0;32m   2733\u001b[0m     return _wrapreduction(a, np.maximum, 'max', axis, None, out,\n\u001b[1;32m-> 2734\u001b[1;33m                           keepdims=keepdims, initial=initial, where=where)\n\u001b[0m\u001b[0;32m   2735\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   2736\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\anaconda3\\lib\\site-packages\\numpy\\core\\fromnumeric.py\u001b[0m in \u001b[0;36m_wrapreduction\u001b[1;34m(obj, ufunc, method, axis, dtype, out, **kwargs)\u001b[0m\n\u001b[0;32m     85\u001b[0m                 \u001b[1;32mreturn\u001b[0m \u001b[0mreduction\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0maxis\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0maxis\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mout\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mout\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mpasskwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     86\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 87\u001b[1;33m     \u001b[1;32mreturn\u001b[0m \u001b[0mufunc\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mreduce\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mobj\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdtype\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mout\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m**\u001b[0m\u001b[0mpasskwargs\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m     88\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     89\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mValueError\u001b[0m: zero-size array to reduction operation maximum which has no identity"
     ]
    }
   ],
   "source": [
    "dj(data_300[data_300[\"symbol\"]==\"SHSE.601990\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['SZSE.000562', 'SHSE.600588', 'SHSE.600109', 'SHSE.600688',\n",
       "       'SHSE.601099', 'SHSE.600582', 'SHSE.601998', 'SHSE.601098',\n",
       "       'SHSE.600519', 'SHSE.600893'], dtype=object)"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stock300 = get_history_constituents(index='SHSE.000300',start_date='2014-01-01',end_date='2014-12-31')[0]['constituents'].keys()\n",
    "stock_s=\"\"\n",
    "n=0\n",
    "for i in stock300:\n",
    "    n=n+1\n",
    "    stock_s=stock_s+i+\",\"\n",
    "    \n",
    "data_300 = history(symbol=stock_s, frequency='1d', start_time='2014-01-01',  \n",
    "                       end_time='2014-12-31', fields='close,eob,symbol', adjust=ADJUST_PREV, df= True,fill_missing=\"Last\")\n",
    "\n",
    "def dj(data_596):\n",
    "    data0=pd.merge(data_596,data_902,on=\"eob\")\n",
    "    Rq=(data0.close_x/data0.shift(1).close_x-1).dropna()\n",
    "    Rm=(data0.close_y/data0.shift(1).close_y-1).dropna()\n",
    "    model = sm.OLS((Rq-Rf), sm.add_constant(Rm-Rf))\n",
    "    result = model.fit()\n",
    "    return result.params\n",
    "\n",
    "s=[]\n",
    "const1=[]\n",
    "close_y=[]\n",
    "n=0\n",
    "for i in stock300:\n",
    "    n=n+1\n",
    "    try:\n",
    "        z1=dj(data_300[data_300[\"symbol\"]==i])\n",
    "        #print(z1,i)\n",
    "        s.append(i)\n",
    "        const1.append(z1.const)\n",
    "        close_y.append(z1.close_y)\n",
    "    except:\n",
    "        continue\n",
    "        \n",
    "\n",
    "r1=pd.DataFrame({\"symbol\":s,\"const\":const1,\"close_y\":close_y})\n",
    "\n",
    "r1.sort_values(by=\"const\",ascending=False).head(10).symbol.values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
